'use strict';
var even_asc_odd_desc = function(collection){

    let arr=new Array();
    arr[0]=new Array();
    arr[1]=new Array;
    for(let item of collection){
        if(item%2==0){
            arr[0].push(item);
        }else{
            arr[1].push(item);
        }
    }
    function sortArr(a,b){
        return a-b;
    }
    arr[0].sort(sortArr);
    arr[1].sort(sortArr).reverse();
    let result=arr.reduce((a,b)=>{
        return a.concat(b);
    })
    return result;
};

module.exports = even_asc_odd_desc;
